java mvn测试失败,但通过IntelliJ IDEA运行测试
我做了一个测试
@RunWith(SpringRunner.class)
@SpringBootTest
@Test
public void testFind() throws IOException {
Review<Hostel> hostelByComplaintId =
hostelService.findByComplaintId(complaintId).orElse(null);
assertThat(hostelByComplaintId).isNotNull();
}
当我从命令行mvn test
运行测试时,我得到了这个错误
Failed tests:
Expecting actual not to be null
但当我从IntelliJ IDEA运行它时,测试并没有失败
# 1 楼答案
如果在项目中发现任何测试用例,您可以只编写complete命令来运行它
如果要禁用运行测试用例